<?php

namespace Kateba\GOOBundle\Form;

use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilder;

class Search extends AbstractType {

    public function buildForm(FormBuilder $builder, array $options) {
        $builder
                ->add('page', 'hidden', array('required' => false, 'data' => 1, 'attr' => array('style' => 'max-width: 800px;')))
                ->add('scope', 'choice', array('required' => false, 'choices' => array('National' => 'National', 'International' => 'International'), 'empty_value' => 'All', 'attr' => array('style' => 'max-width: 800px;')))
                ->add('projectType', 'choice', array('required' => false, 'choices' => array('Educational-Enhancement' => 'Educational/Enhancement', 'Mobility' => 'Mobility', 'Research' => 'Research'), 'empty_value' => 'All', 'attr' => array('style' => 'max-width: 800px;')))
                ->add('mobilityLevel', 'entity', array('required' => false, 'class' => 'KatebaGOOBundle:MobilityLevel', 'empty_value' => 'All', 'attr' => array('style' => 'max-width: 800px;')))
                ->add('fundingAgency', 'entity', array('required' => false, 'class' => 'KatebaGOOBundle:FundingAgency', 'empty_value' => 'All', 'attr' => array('style' => 'max-width: 800px;')))
                ->add('studyField', 'entity', array('required' => false, 'class' => 'KatebaGOOBundle:StudyField', 'empty_value' => 'All', 'attr' => array('style' => 'max-width: 800px;')))
                ->add('country', 'entity', array('required' => false, 'class' => 'KatebaGOOBundle:Country', 'empty_value' => 'All', 'attr' => array('style' => 'max-width: 800px;')))
        ;
    }

    public function getName() {
        return 'Kateba_goobundle_searchtype';
    }

    public function getDefaultOptions(array $options) {
        $options['csrf_protection'] = false;
        return $options;
    }

}
